<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    function User(name, sex, age) {
        this.name = name;
        this.sex = sex;
        this.age = age;
    }
    User.prototype.showJson = function() {
        console.log(JSON.stringify(this, null, 2));
    };
    User.prototype.name = "江泽民";

    var tstUser = new User("顾世豪", "男", 24);

    console.log(JSON.stringify(Object.getOwnPropertyDescriptor(tstUser, "name")));
    console.log(tstUser.name);
    console.log(tstUser.hasOwnProperty("name"));

    delete tstUser.name;

    console.log(JSON.stringify(Object.getOwnPropertyDescriptor(User.prototype, "name")));
    console.log(tstUser.name);
    console.log(tstUser.hasOwnProperty("name"));

</script>
</body>
</html>